package com.zhuoshi.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhuoshi.entity.Bargain;
import com.zhuoshi.entity.BargainCustom;
import com.zhuoshi.mapper.BargainMapper;
import com.zhuoshi.service.BargainService;
@Service("bargainService")
@Transactional
public class BargainServiceImpl implements BargainService{
	@Autowired
	private BargainMapper bargainMapper;
//	查询所有合同
	public List<BargainCustom> selectBargainList() throws Exception {
		return bargainMapper.selectBargainList();
	}

	

//	删除合同（单个与批量都可以）
	public Integer deleteBargainByIds(Integer[] ids) throws Exception {
		Integer  deleteByPrimaryKey=null;
		for (Integer id : ids) {
			deleteByPrimaryKey = bargainMapper.deleteByPrimaryKey(id);
		}
		
		return deleteByPrimaryKey;
	}


//  订单中的去签合同
	public int quQianHeTongLiu(Bargain bargain) throws Exception {
		return bargainMapper.insertSelective(bargain);
	}
	
}
